package com.kyw.androidquicktest.util;

import android.os.Bundle;
import android.os.PersistableBundle;

import com.kyw.androidquicktest.R;

import java.lang.reflect.ParameterizedType;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

public abstract class BaseActivity extends AppCompatActivity {
    public ViewModel viewModel;
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutId());
        viewModel = getViewModel();
        initData();
    }

    protected abstract void initData();

    protected abstract int getLayoutId();

    protected abstract ViewModel getViewModel();

}
